<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" charset="utf-8">
		
		//Number()
		var s1='100'
		var s2='123abc'
		var s3='123.23abc'
		var n1
		n1=Number(s1)
		console.log(s1+'是合法数字')
		console.log(n1)
		console.log(typeof n1)
		
		
		n1=Number(s2)
		console.log(s2+'是不合法数字')
		console.log(n1)
		console.log(typeof n1)
		
		//ParseInt()
		n1= parseInt(s1)
		console.log(s1+'是合法数字')
		console.log(n1)
		console.log(typeof n1)
		
		n1=parseInt(s2)
		console.log(s2+'是不合法数字')
		console.log(n1)
		console.log(typeof n1)
		
		//ParseFloat()
		n1=parseFloat(s2)
		console.log(n1)
		n1=parseInt(s3)
		console.log(n1)
		</script>
	</head>
	<body>

	</body>
</html>
